From e73effa056c01e832553273d9fd2634be341d6fa Mon Sep 17 00:00:00 2001 From: "emellor@leeni.uk.xensource.com" Date: Tue, 23 May 2006 16:23:10 +0100 Subject: [PATCH] Allow a guest to determine its VM UUID. Use xenstore-read $(xenstore-read vm)/uuid. Signed-off-by: Ewan Mellor --- tools/python/xen/xend/XendDomainInfo.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tools/python/xen/xend/XendDomainInfo.py b/tools/python/xen/xend/XendDomainInfo.py index 8be996c5a2..e28f9914a1 100644 --- a/tools/python/xen/xend/XendDomainInfo.py +++ b/tools/python/xen/xend/XendDomainInfo.py @@ -701,6 +701,16 @@ class XendDomainInfo: log.debug("Storing VM details: %s", to_store) self.writeVm(to_store) + self.setVmPermissions() + + + def setVmPermissions(self): + """Allow the guest domain to read its UUID. We don't allow it to + access any other entry, for security.""" + xstransact.SetPermissions('%s/uuid' % self.vmpath, + { 'dom' : self.domid, + 'read' : True, + 'write' : False }) def storeDomDetails(self): -- 2.30.2